<template>
  <div>
    <index-cmpt :models="models" v-if="authority"></index-cmpt>
    <template v-else>
      <div class="p-5 text-center text-muted border rounded bg-light">
        如需使用该功能请联系数科公司： 唐超： 13985332965
      </div>
    </template>
  </div>
</template>

<script>
import IndexCmpt from '@/credit/views/city/bus/index/IndexCmpt'
import { mapGetters } from 'vuex'
export default {
  components: {
    IndexCmpt,
  },
  props: {},
  data() {
    return {}
  },
  computed: {
    ...mapGetters(['taskCountBusSelfFast', 'user']),
    scopes() {
      return this.user.scopes
    },
    authority() {
      const scopeArray = this.scopes.split('|')
      return scopeArray.includes('dirGua')
    },
    models() {
      return [
        {
          title: '项目登记',
          subTitle: '待办',
          subCount: this.taskCountBusSelfFast.todo_claim_total || 0,
          url: '/credit/task/self/fast/item',
          handlerUrl: '/credit/task/self/fast/item_no',
        },
        {
          title: '放款登记',
          subTitle: '待办',
          subCount: this.taskCountBusSelfFast.todo_loan_register_total || 0,
          url: '/credit/task/self/fast/register',
          handlerUrl: '/credit/task/self/fast/register_no',
        },
        {
          title: '贷后管理',
          subTitle: '到期',
          subCount: this.taskCountBusSelfFast.todo_exp_total || 0,
          url: '/credit/task/self/fast/postloan',
          handlerUrl: '/credit/task/self/fast/postloan_no',
        },
      ]
    },
  },
  watch: {},
  created() {
    this.$store.dispatch('getTaskCountBusSelfFast')
  },
  mounted() {},
  methods: {},
}
</script>

<style lang="scss" scoped></style>
